package com.coocaa.ops.api.v1.home.util;

import com.coocaa.ops.api.common.model.HeaderModel;
import com.coocaa.ops.api.v1.home.handler.StoreModeHandler;
import com.coocaa.ops.api.v1.home.model.query.HomeQueryModel;
import com.coocaa.ops.api.v1.policy.model.PolicyModel;

/**
 * @author tangminghong
 * @date 2020-06-22
 */
public class HomeQueryUtil {

    public static HomeQueryModel getHomeQuery(HeaderModel header, PolicyModel policyModel) {
        HomeQueryModel homeQueryModel = new HomeQueryModel();
        homeQueryModel.setPolicyCategory(policyModel.getCategory());
        homeQueryModel.setHomepageId(policyModel.getHomepageId());
        homeQueryModel.setStoreMode(StoreModeHandler.isStoreMode(header.getCFMode()));
        homeQueryModel.setHeader(header);
        return homeQueryModel;
    }
}
